package by.scsbsu.database.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public abstract class AbstractDAO {
	public static final String CHARSET = "UTF-8";
	protected static ResultSet resultSet;
	protected static Connection connection;
	protected static PreparedStatement statement;
	//protected Logger logger = Logger.getLogger(UserDAO.class);
	
	public static void close() {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException ex) {
                //logger.error(ex);
            }
        }
        if(statement != null){
        	try {
				statement.close();
			} catch (SQLException e) {
				e.printStackTrace();
			}
        }
        if(connection != null) {
        	try {
				connection.close();
			} catch (SQLException e) {
				e.printStackTrace();
			}
        }
    }
}
